package cn.ekuma.data.ui.android;

import android.content.Context;

import java.util.List;

import cn.ekuma.data.dao.bean.I_BaseBean;

/**
 * Created by Administrator on 2014/12/16.
 */
public abstract class AbstractBaseBeanListAdapter<T extends I_BaseBean<String>> extends AbstractViewBeanListAdapter<T> {

    public AbstractBaseBeanListAdapter(Context context, List<T> objects) {
        super(context, objects);
    }

    public AbstractBaseBeanListAdapter(Context context) {
        super(context);
    }

    public int getPositionByObjectId(String id){
      if(id==null)
          return -1;
     for(int position=0;position<this.getCount();position++){
        if(this.getItem(position).getKey().equalsIgnoreCase(id))
          return position;
       }
        return -1;
     }
}
